function resourceController(){
	var Self = this;
	this.init = function(){
	};
	
	this.createFilesFromFile = function(files){
		var result = [];
		var context = new webkitAudioContext();
		
        for (var i in files) {
        	if(files[i].name == null || files[i].name == "item"){
        		continue;
        	}
            var f = files[i]; //JS File vom drop
     		var reader = new FileReader();
            result.push(new mediaItem()); //unser file object
            reader.newFile = result[result.length-1]; //unser file object
            reader.newFile.Id = Self.unique();
            reader.newFile.Name = f.name;
            reader.newFile.Size = f.size;
            reader.newFile.Type = f.type;

			reader.onload = function(e){
				//buffering finished
				var newFile = this.newFile;
				context.decodeAudioData(e.target.result, function(buffer){
					//decoding finished
					$("#info ul").prepend("<li>buffering \""+newFile.Name+"\" done</li>");
					newFile.addChunk(buffer);
					newFile.Length = buffer.length;
					newFile.complete();
			        CORE.notify("onStateChanged", {
						activeItem: false,
						paused: false,
						playing: false
					});
				}, function(){console.log("cant decode")});
			};
			
			reader.onloadstart = function(e){
					$("#info ul").prepend("<li>buffering \""+e.target.newFile.Name+"\" (" + e.target.result.byteLength + " bytes)</li>"); 
			};
			
            reader.onerror = function(e){
               console.log("error");
               console.log(e.currentTarget.error.code);
            };
			reader.readAsArrayBuffer(f);
		}
       return result;
		
	};

	/**
	 * @param data Array<tempMediaItem>
	 */
	this.createFilesFromStream = function(data){
		var Items = [];
		$(data).each(function(key, value){
			Items.push(new mediaItem());
			$.extend(Items[key], value);
			Items[key].Id = Self.unique();
		});
		return Items;
	};
	
	this.unique = function(){
		var d = new Date();
		return d.getTime();
	};

	this.init();
}